/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author HP
 */
@Embeddable
public class OrdersDetailsPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "ordersID", nullable = false)
    private int ordersID;
    @Basic(optional = false)
    @Column(name = "productID", nullable = false)
    private int productID;

    public OrdersDetailsPK() {
    }

    public OrdersDetailsPK(int ordersID, int productID) {
        this.ordersID = ordersID;
        this.productID = productID;
    }

    public int getOrdersID() {
        return ordersID;
    }

    public void setOrdersID(int ordersID) {
        this.ordersID = ordersID;
    }

    public int getProductID() {
        return productID;
    }

    public void setProductID(int productID) {
        this.productID = productID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) ordersID;
        hash += (int) productID;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof OrdersDetailsPK)) {
            return false;
        }
        OrdersDetailsPK other = (OrdersDetailsPK) object;
        if (this.ordersID != other.ordersID) {
            return false;
        }
        if (this.productID != other.productID) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.OrdersDetailsPK[ordersID=" + ordersID + ", productID=" + productID + "]";
    }

}
